package main

import "fmt"

func findIntersectionValues1(nums1 []int, nums2 []int) []int {
	m := make(map[int]struct{})
	for _, v := range nums1 {
		m[v] = struct{}{}
	}
	i := 0
	for _, v := range nums2 {
		if _, ok := m[v]; ok {
			nums1[i] = v
			i++
		}
	}
	return nums1[:i]
}
func findIntersectionValues(nums1 []int, nums2 []int) []int {
    res := make([]int, 2)
    for _, x1 := range nums1 {
        for _, x2 := range nums2 {
            if x1 == x2 {
                res[0]++
                break
            }
        }
    }
    for _, x2 := range nums2 {
        for _, x1 := range nums1 {
            if x2 == x1 {
                res[1]++
                break
            }
        }
    }
    return res
}

func main() {
	nums1 := []int{2, 3, 2}
	nums2 := []int{1, 2}
	res := findIntersectionValues(nums1, nums2)
	fmt.Println(res)
}